import { helper } from '@ember/component/helper';

export function get([obj, key, defaultValue]) {
  if (obj && typeof obj === 'object' && obj[key] !== undefined) {
    return obj[key];
  }
  return defaultValue !== undefined ? defaultValue : obj;
}

export default helper(get);